-
.
-
It doesn't matter what method we use for computing the GI.
-
Access the data from a texture; trilinear filter it and we are done.
-
Easy and cheap.
-
Only works for static scenes.
Light Maps
-
.
-
.
-
-
-
See the source in VSCode.
-
-
Limitations :
-
Specularity changes based on the angle of the camera, so it cannot be baked into the geometry; this is view dependent.
-
No specular indirect lighting baked.
-
.
-
Light Bleeding
-
Fixing light bleeding in Lightmaps - Unity .
-
Solutions :
-
If you provide lightmap UVs yourself, add margins using your modeling package.
-
~If Unity automatically generates the lightmap UVs for a Model, you can tell Unity to increase the pack margin. Bla bla bla.
-
Increase the resolution:
-
Of the entire lightmap. This will increase the number of pixels between the charts and therefore reduce the likelihood of bleeding. The downside is that your lightmap may become too large.
-
Of a single GameObject. This allows you to increase lightmap resolution only for GameObjects that have overlapping UVs. Though less likely, this can also increase your lightmap size.
-
-
I believe what Unity means is:
-
It must use a different texture for lightmaps, overlaid on top of the albedo.
-
Therefore, it makes sense to talk about "increasing the lightmap resolution" since it's a separate texture.
-
-
-
-
Aliasing on UV Seams - Adobe .
-
Solutions :
-
Increase the output texture resolution of the Bakers.
-
Increase the Anti-aliasing setting (note: it may take more time to compute).
-
Align the UVs to the pixel grid in the UV editor of the 3D modeling software.
-
Give a better Texel Ratio to UVs.
-
-
-
My question :
-
Caio:
-
the light is baked in, so I guess it makes sense to be a UV issue, causing the texture bleeding
-
-
devsh:
-
.
-
welcome to the fundamental problem with lightmapping
-
Pixar solves it with PTEX .
-
"Per-Face Texture Mapping for Production Rendering".
-
-
as a mere mortal you need to clamp the max mip level, anisotropy, and add padding texels around every UV island
-
you may also want to adjust the way you island your faces
-
-
Caio:
-
Interesting, I've never heard of this. I'm not using mipmap nor AA for now, I'm still setting things up
-
-
Devsh:
-
well then it's bilinear interpolation bleed
-
your pixel centers are not on the edge, there are no padding/border pixels.
-
-
Caio:
-
so it's not a problem with the UVs?
-
I'm a bit confused, is this fixed by implementing AA or mipmap?
-
-
Devsh:
-
no, it's made worse by mip-mapping
-
-
Caio:
-
so, from what I'm seeing, this is caused when generating the lightmap and baking the light color into the albedo texture? The lack of padding or UV overlap, etc. So, from what I'm understanding, this isn't caused by some oversight on my part, but this is an external issue that my render engine could fix at runtime? You said something about "bilinear interpolation bleed" "clamp the max mip level, anisotropy and add padding texels around every UV island", so I got confused about who's to blame for the artifact, my rendering engine or external software used to generate the lightmap?
-
-
Devsh:
-
both, you need to generate the input data better, and your engine needs to take care not to accidentally enable mip-mapping later on
-
-
Caio:
-
just a final clarification: are you considering that the lightmap is from a separate texture from the albedo, or the light is baked into the albedo? This is a free model, I didn't make the light baking myself. So when you say "generate the input data better", are you referring to the texture the light was baked into, or some other "input"? Finally, if it is the case that I can't rebake the texture, is there something I can do to reduce the artifact, or are all my options just to keep it from getting worse with mipmapping?
-
-